package eraserhead.xml.response;

import org.w3c.dom.Node;

import xml.Message;
import client.IMessageHandler;
import eraserhead.xml.XmlNode;

/**
 * Response handler for SignInClosed
 * @author Michael Checca
 */
public class SignInResponse implements IMessageHandler {

	@Override
	public void process(Message response) {
		Node signin = XmlNode.findNode(response.contents, "signInResponse");
		if (signin != null) {
			String type = XmlNode.getAttribute(signin, "type");
			if (type.equals("open"))
				new SignInOpenResponse().process(response);
			else if (type.equals("closed"))
				new SignInClosedResponse().process(response);
		}
	}
}
